package dgut.haitaobao.service.impl;

import dgut.haitaobao.entry.ProductCommentsVO;
import dgut.haitaobao.mapper.ProductCommentsMapper;
import dgut.haitaobao.service.ProductCommentsService;
import dgut.haitaobao.util.response.HttpResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ProductCommentsServiceImpl implements ProductCommentsService {

    @Resource
    private ProductCommentsMapper productCommentsMapper;

    @Override
    public HttpResponse getProductCommentsByProductId(String productId) {
        List<ProductCommentsVO> productComments = productCommentsMapper.getProductCommentsByProductId(productId);
        return HttpResponse.success(productComments);
    }
}
